<?php 

set_time_limit(0);

$a = glob('./style/cartoon/*.css');

foreach($a as $f){
$css = file_get_contents($f);
preg_match_all('/url\(([^\)]+)\)/i',$css,$matchs);
foreach($matchs[1] as $i){
$i = str_replace('../','',$i);
if(file_exists('./style/'.$i))continue;
	$data = file_get_contents('http://www.hei100.com/theme/default/'.$i);
	file_put_contents('./style/'.$i,$data);
}

}
?>